using Jupiter.Infrastructure.Responses;
using Wips.AppService.Authorities.Operations.Requests;
using Wips.AppService.Authorities.Operations.Responses;
using Wips.AppService.Authorities.Operations.ViewModels;

namespace Wips.AppService.Authorities.Operations
{
    /// <summary>
    /// 操作服务接口
    /// </summary>
    public interface IOperationService
    {
        /// <summary>
        /// 读取分页列表
        /// </summary>
        /// <param name="request">请求类</param>
        /// <returns></returns>
        Task<PageResult<GetOperationPagesResponse>> GetPagesAsync(GetOperationPagesRequest request);

        /// <summary>
        /// 读取信息
        /// </summary>
        /// <param name="id">Id</param>
        /// <returns></returns>
        Task<OperationViewModel> GetByIdAsync(string id);

        /// <summary>
        /// 读取权限代码
        /// </summary>
        /// <param name="userId">用户Id，默认为当前登录用户</param>
        /// <returns></returns>
        Task<List<string>> GetCodesByUserIdAsync(string userId = null);


        /// <summary>
        /// 根据用户版本读取菜单
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="isRoot"></param>
        /// <returns></returns>
        Task<List<OperationViewModel>> GetVersionsOperationAsync(string userId,
            bool isRoot = false);
    }
}